from appium import webdriver
from appium.webdriver.common.touch_action import TouchAction
from selenium.webdriver.common.by import By

desired_caps = {
    'platformName': 'Android',
    'platformVersion': '6.0',
    'deviceName': '192.168.56.109:5555',
    'appPackage': 'com.android.settings',
    'appActivity': '.Settings',
    'resetKeyBoard': True,
    'unicodeKeyboard': True,
    'noReset': True,
    'automationName': 'Uiautomator2'
    # 'dontStopAppOnReset': True,# 首次启动的时候, 不停止app
    # 'skipDeviceInitialization': True # 跳过安装,权限设置等操作
}

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
driver.find_element_by_accessibility_id('这里放入content-desc')
# expected_conditions


# driver.close_app()
driver.quit()